package io.seata.samples.tcc.springboot.dubbo.controller;

import io.seata.samples.tcc.springboot.dubbo.service.ActionOneService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class ActionOneController {

    @Resource
    private ActionOneService actionOneService;

    @GetMapping("/prepare")
    public String prepare(@RequestParam(name = "param") String param) {
        return actionOneService.prepare(param);
    }

    @GetMapping("/commit")
    public String commit(@RequestParam(name = "param") String param) {
        return actionOneService.commit(param);
    }

    @GetMapping("/rollback")
    public String rollback(@RequestParam(name = "param") String param) {
        return actionOneService.rollback(param);
    }
}
